/*
 * blink.c
 *
 *  Created on: 25.11.2009
 *      Author: Anton Golubkov
 */

#include "blink.h"



void ioinit(void) {
	DDRC = 0b11011111; //1 = output, 0 = input
	PORTC = 0b00100000; //Enable pin 5 internal pullup
}

void led_on(void) {
	PORTC |= _BV(PC3);
}

void led_off(void) {
	PORTC &= ~_BV(PC3);
}


void blink(uint8_t blink_count, double period) {
	uint8_t i;
	for (i = 0; i < blink_count; i++) {
		led_off();
		_delay_ms(period);
		led_on();
		_delay_ms(period);
	}
	led_off();
}
